import axios from "axios"

import { getRefreshToken, getToken } from '@/utils/auth'
export function refreshToken() {
  
    return new Promise( async (resolve, reject)=> {

        axios({
            method: 'post',
            url: 'https://api.zhxia.net/api/refresh',
            headers: {
              Authorization: 'Bearer ' + getToken()
            },
            data: {
                refresh_token: getRefreshToken()
            }
          }).then(res=>{
             resolve(res)
          }).catch(err=>{
              reject(err.response)
          })
    })

}



